package com.qf.controller;/*
 *保护你的大熊
 *2021/11/23
 *8:58
 */

import org.apache.shiro.authz.annotation.Logical;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.apache.shiro.authz.annotation.RequiresRoles;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class TestController {

//    @RequiresRoles("管理员")  判断该用户是否拥有该角色
    @RequiresPermissions(value = {"sys:user:add","sys:user:update"},logical = Logical.OR)
    @RequestMapping("/test")
    public String test(){
        System.out.println("测试方法1");
        return "success";
    }

//    @RequiresRoles("开发工程师")
    @RequiresPermissions(value = {"sys:kaoqing:add"}) //判断该用户是否拥有某权限
    @RequestMapping("/test1")
    public String test1(){
        System.out.println("测试方法2");
        return "success";
    }
}
